import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout } from '#/layouts';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'mdi:alert-octagon',
      order: 2000,
      title: $t('page.agileEmergency.title'),
    },
    name: 'AgileEmergency',
    path: '/agile-emergency',
    children: [
      // {
      //   name: 'AgileEmergencyHome',
      //   path: 'home',
      //   component: () => import('#/views/agile-emergency/Home.vue'),
      //   meta: {
      //     icon: 'mdi:home',
      //     title: $t('page.agileEmergency.home'),
      //   },
      // },
      //
      {
        name: 'PlanManagement',
        path: 'plan-management',
        meta: {
          icon: 'mdi:file-document-edit',
          title: $t('page.agileEmergency.planManagement'),
          authority: ['AC100000', 'AC100001', 'AC999999', 'AC100010'],
        },
        children: [
          {
            name: 'PlanEntry',
            path: 'plan-entry',
            component: () =>
              import('#/views/agile-emergency/plan-management/PlanEntry.vue'),
            meta: {
              // icon: 'mdi:file-plus',
              title: $t('page.agileEmergency.planEntry'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'Revisemergency',
            path: 'Revis-emergency',
            component: () =>
              import(
                '#/views/agile-emergency/plan-management/Revisemergency.vue'
              ),
            meta: {
              // icon: 'mdi:file-cabinet',
              title: $t('page.agileEmergency.revisemergency'),
              authority: ['AC100000', 'AC100001'],
            },
          },

          //
          {
            name: 'PlanReview',
            path: 'plan-review',
            component: () =>
              import('#/views/agile-emergency/plan-management/PlanReview.vue'),
            meta: {
              // icon: 'mdi:file-check',
              title: $t('page.agileEmergency.planReview'),
              authority: ['AC100000', 'AC100001', 'AC100010', 'AC999999'],
            },
          },
          //
          {
            name: 'PlanFiling',
            path: 'plan-filing',
            component: () =>
              import('#/views/agile-emergency/plan-management/PlanFiling.vue'),
            meta: {
              // icon: 'mdi:file-cabinet',
              title: $t('page.agileEmergency.planFiling'),
              authority: ['AC100000', 'AC100001'],
            },
          },

          // {
          //   name: 'SuperiorPlanEntry',
          //   path: 'superior-plan-entry',
          //   component: () => import('#/views/agile-emergency/plan-management/SuperiorPlanEntry.vue'),
          //   meta: {
          //     icon: 'mdi:file-upload',
          //     title: $t('page.agileEmergency.superiorPlanEntry'),
          //   },
          // },
          {
            name: 'PlanAnalysis',
            path: 'plan-analysis',
            component: () =>
              import(
                '#/views/agile-emergency/plan-management/PlanAnalysis.vue'
              ),
            meta: {
              // icon: 'mdi:chart-line',
              title: $t('page.agileEmergency.planAnalysis'),
              authority: ['AC100000', 'AC100001'],
            },
          },
        ],
      },
      //
      {
        name: 'ResourceManagement',
        path: 'resource-management',
        meta: {
          icon: 'mdi:package-variant',
          title: $t('page.agileEmergency.resourceManagement'),
          authority: ['AC100000', 'AC100001'],
        },
        children: [
          {
            name: 'ResourceConvergence',
            path: 'resource-convergence',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/ResourceConvergence.vue'
              ),
            meta: {
              // icon: 'mdi:arrow-decision',
              title: $t('page.agileEmergency.resourceConvergence'),
              authority: ['AC100000', 'AC100001'],
            },
          },

          {
            name: 'ExpertAssessment',
            path: 'expert-assessment',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/ExpertAssessment.vue'
              ),
            meta: {
              // icon: 'mdi:account-star',
              title: $t('page.agileEmergency.expertAssessment'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'TeamAssessment',
            path: 'team-assessment',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/TeamAssessment.vue'
              ),
            meta: {
              // icon: 'mdi:account-star',
              title: $t('page.agileEmergency.teamAssessment'),
              authority: ['AC100000', 'AC100001'],
            },
          },

          {
            name: 'MaterialAssessment',
            path: 'material-assessment',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/MaterialAssessment.vue'
              ),
            meta: {
              // icon: 'mdi:clipboard-check',
              title: $t('page.agileEmergency.materialAssessment'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          // {
          //   name: 'MaterialVisualization',
          //   path: 'material-visualization',
          //   component: () => import('#/views/agile-emergency/resource-management/MaterialVisualization.vue'),
          //   meta: {
          //     icon: 'mdi:chart-areaspline',
          //     title: $t('page.agileEmergency.materialVisualization'),
          //   },
          // },
          {
            name: 'EmergencyShelter',
            path: 'emergency-shelter',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/EmergencyShelter.vue'
              ),
            meta: {
              // icon: 'mdi:home-circle',
              title: $t('page.agileEmergency.emergencyShelter'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'MedicalResources',
            path: 'medical-resources',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/MedicalResources.vue'
              ),
            meta: {
              // icon: 'mdi:medical-bag',
              title: $t('page.agileEmergency.medicalResources'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'MaterialAnalysis',
            path: 'material-analysis',
            component: () =>
              import(
                '#/views/agile-emergency/resource-management/MaterialAnalysis.vue'
              ),
            meta: {
              // icon: 'mdi:chart-box',
              title: $t('page.agileEmergency.materialAnalysis'),
              authority: ['AC100000', 'AC100001'],
            },
          },
        ],
      },
      //
      {
        name: 'DrillManagement',
        path: 'drill-management',
        meta: {
          icon: 'mdi:run-fast',
          title: $t('page.agileEmergency.drillManagement'),
          authority: ['AC100000', 'AC100001'],
        },
        children: [
          {
            name: 'DrillPlan',
            path: 'drill-plan',
            component: () =>
              import('#/views/agile-emergency/drill-management/DrillPlan.vue'),
            meta: {
              // icon: 'mdi:clipboard-outline',
              title: $t('page.agileEmergency.drillPlan'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'DrillScheme',
            path: 'drill-scheme',
            component: () =>
              import(
                '#/views/agile-emergency/drill-management/DrillScheme.vue'
              ),
            meta: {
              // icon: 'mdi:clipboard-outline',
              title: $t('page.agileEmergency.drillScheme'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'DrillRecord',
            path: 'drill-record',
            component: () =>
              import(
                '#/views/agile-emergency/drill-management/DrillRecord.vue'
              ),
            meta: {
              // icon: 'mdi:clipboard-list',
              title: $t('page.agileEmergency.drillRecord'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'DrillSummary',
            path: 'drill-summary',
            component: () =>
              import(
                '#/views/agile-emergency/drill-management/DrillSummary.vue'
              ),
            meta: {
              // icon: 'mdi:clipboard-list',
              title: $t('page.agileEmergency.drillSummary'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'DrillVideo',
            path: 'drill-video',
            component: () =>
              import('#/views/agile-emergency/drill-management/DrillVideo.vue'),
            meta: {
              // icon: 'mdi:clipboard-list',
              title: $t('page.agileEmergency.drillVideo'),
              authority: ['AC100000', 'AC100001'],
            },
          },
        ],
      },
      //
      {
        name: 'CommandDispatchX',
        path: 'command-dispatch-x',

        meta: {
          icon: 'mdi:view-dashboard',
          title: $t('page.agileEmergency.commandDispatchX'),
          authority: ['AC100000', 'AC100001'],
        },
        children: [
          {
            name: 'DutyManagement',
            path: 'duty-management',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/DutyManagement.vue'
              ),
            meta: {
              // icon: 'mdi:calendar-clock',
              title: $t('page.agileEmergency.dutyManagement'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'VehicleDispatch',
            path: 'vehicle-dispatch',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/VehicleDispatch.vue'
              ),
            meta: {
              // icon: 'mdi:car-emergency',
              title: $t('page.agileEmergency.vehicleDispatch'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'EmergencyBroadcast',
            path: 'emergency-broadcast',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/EmergencyBroadcast.vue'
              ),
            meta: {
              // icon: 'mdi:car-emergency',
              title: $t('page.agileEmergency.emergencybroadcast'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'AlarmManagement',
            path: 'alarm-management',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/AlarmManagement.vue'
              ),
            meta: {
              // icon: 'mdi:alarm-light',
              title: $t('page.agileEmergency.alarmManagement'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'ReportManagement',
            path: 'report-management',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/ReportManagement.vue'
              ),
            meta: {
              // icon: 'mdi:file-chart',
              title: $t('page.agileEmergency.reportManagement'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'FollowUpReport',
            path: 'follow-up-report',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/FollowUpReport.vue'
              ),
            meta: {
              // icon: 'mdi:file-document-edit',
              title: $t('page.agileEmergency.followUpReport'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'CommandIssuance',
            path: 'command-issuance',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/CommandIssuance.vue'
              ),
            meta: {
              // icon: 'mdi:file-document-edit',
              title: $t('page.agileEmergency.commandIssuance'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'CommandFeedback',
            path: 'command-feedback',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/CommandFeedback.vue'
              ),
            meta: {
              // icon: 'mdi:file-document-edit',
              title: $t('page.agileEmergency.commandFeedback'),
              authority: ['AC100000', 'AC100001'],
            },
          },








          {
            name: 'RescueProcessRecord',
            path: 'rescue-process-record',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/RescueProcessRecord.vue'
              ),
            meta: {
              // icon: 'mdi:lifebuoy',
              title: $t('page.agileEmergency.rescueProcessRecord'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'EmergencyPlanRecord',
            path: 'emergency-plan-record',
            component: () =>
              import(
                '#/views/agile-emergency/command-dispatch/EmergencyPlanRecord.vue'
              ),
            meta: {
              // icon: 'mdi:clipboard-text',
              title: $t('page.agileEmergency.emergencyPlanRecord'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          // {
          //   name: 'ResourceAllocation',
          //   path: 'resource-allocation',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/ResourceAllocation.vue'
          //     ),
          //   meta: {
          //     // icon: 'mdi:view-dashboard',
          //     title: $t('page.agileEmergency.resourceAllocation'),
          //   },
          // },
        ],
      },
      //
      {
        name: 'AssistantDecision',
        path: 'assistant-decision',
        meta: {
          icon: 'mdi:radio-tower',
          title: $t('page.agileEmergency.assistantDecision'),
          authority: ['AC100000', 'AC100001'],
        },
        children: [
          {
            name: 'AccidentSimulation',
            path: 'accident-simulation',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/AccidentSimulation.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.accidentSimulation'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'ResourceOptimization',
            path: 'resource-optimization',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/ResourceOptimization.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.resourceOptimization'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'Negotiations',
            path: 'negotiations',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/Negotiations.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.negotiations'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'MeteorologicalInformation',
            path: 'meteorological-information',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/MeteorologicalInformation.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.meteorologicalInformation'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'GasConcentration',
            path: 'gas-concentration',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/GasConcentration.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.gasConcentration'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'DisasterSimulation',
            path: 'disaster-simulation',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/DisasterSimulation.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.disasterSimulation'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          {
            name: 'EmergencyPlan',
            path: 'emergency-plan',
            component: () =>
              import(
                '#/views/agile-emergency/decision-support/EmergencyPlan.vue'
              ),
            meta: {
              // icon: 'mdi:view-dashboard',
              title: $t('page.agileEmergency.emergencyPlan'),
              authority: ['AC100000', 'AC100001'],
            },
          },
          // {
          //   name: 'AlarmManagement',
          //   path: 'alarm-management',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/AlarmManagement.vue'
          //     ),
          //   meta: {
          //     icon: 'mdi:alarm-light',
          //     title: $t('page.agileEmergency.alarmManagement'),
          //   },
          // },
          // {
          //   name: 'ReportManagement',
          //   path: 'report-management',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/ReportManagement.vue'
          //     ),
          //   meta: {
          //     icon: 'mdi:file-chart',
          //     title: $t('page.agileEmergency.reportManagement'),
          //   },
          // },
          // {
          //   name: 'FollowUpReport',
          //   path: 'follow-up-report',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/FollowUpReport.vue'
          //     ),
          //   meta: {
          //     icon: 'mdi:file-document-edit',
          //     title: $t('page.agileEmergency.followUpReport'),
          //   },
          // },
          // {
          //   name: 'RescueProcessRecord',
          //   path: 'rescue-process-record',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/RescueProcessRecord.vue'
          //     ),
          //   meta: {
          //     icon: 'mdi:lifebuoy',
          //     title: $t('page.agileEmergency.rescueProcessRecord'),
          //   },
          // },
          // {
          //   name: 'EmergencyPlanRecord',
          //   path: 'emergency-plan-record',
          //   component: () =>
          //     import(
          //       '#/views/agile-emergency/command-dispatch/EmergencyPlanRecord.vue'
          //     ),
          //   meta: {
          //     icon: 'mdi:clipboard-text',
          //     title: $t('page.agileEmergency.emergencyPlanRecord'),
          //   },
          // },
        ],
      },
      //
      // {
      //   name: 'DecisionSupport',
      //   path: 'decision-support',
      //   meta: {
      //     icon: 'mdi:lightbulb-on',
      //     title: $t('page.agileEmergency.decisionSupport'),
      //   },
      //   children: [
      //     {
      //       name: 'DecisionAnalysis',
      //       path: 'decision-analysis',
      //       component: () => import('#/views/agile-emergency/decision-support/DecisionAnalysis.vue'),
      //       meta: {
      //         icon: 'mdi:chart-bar',
      //         title: $t('page.agileEmergency.decisionAnalysis'),
      //       },
      //     },
      //     {
      //       name: 'DecisionData',
      //       path: 'decision-data',
      //       component: () => import('#/views/agile-emergency/decision-support/DecisionData.vue'),
      //       meta: {
      //         icon: 'mdi:database',
      //         title: $t('page.agileEmergency.decisionData'),
      //       },
      //     },
      //   ],
      // },

      //
      // {
      //   name: 'PublicEngineering',
      //   path: 'public-engineering',
      //   meta: {
      //     icon: 'mdi:city',
      //     title: $t('page.agileEmergency.publicEngineering'),
      //   },
      //   children: [
      //     {
      //       name: 'RealTimeMonitoring',
      //       path: 'real-time-monitoring',
      //       component: () =>
      //         import(
      //           '#/views/agile-emergency/public-engineering/RealTimeMonitoring.vue'
      //         ),
      //       meta: {
      //         // icon: 'mdi:monitor-dashboard',
      //         title: $t('page.agileEmergency.realTimeMonitoring'),
      //       },
      //     },
      //     {
      //       name: 'EquipmentInfo',
      //       path: 'equipment-info',
      //       component: () =>
      //         import(
      //           '#/views/agile-emergency/public-engineering/EquipmentInfo.vue'
      //         ),
      //       meta: {
      //         // icon: 'mdi:tools',
      //         title: $t('page.agileEmergency.equipmentInfo'),
      //       },
      //     },
      //     {
      //       name: 'InstrumentInfo',
      //       path: 'instrument-info',
      //       component: () =>
      //         import(
      //           '#/views/agile-emergency/public-engineering/InstrumentInfo.vue'
      //         ),
      //       meta: {
      //         // icon: 'mdi:gauge',
      //         title: $t('page.agileEmergency.instrumentInfo'),
      //       },
      //     },

      //     {
      //       name: 'SummaryStatistics',
      //       path: 'summary-statistics',

      //       meta: {
      //         // icon: 'mdi:chart-bar',
      //         title: $t('page.agileEmergency.summaryStatistics'),
      //       },
      //       children: [
      //         {
      //           name: 'SummaryStatisticss',
      //           path: 'summary-statisticss',
      //           component: () =>
      //           import(
      //             '#/views/agile-emergency/public-engineering/SummaryStatistics.vue'
      //           ),
      //           meta: {
      //             // icon: 'mdi:gauge',
      //             title: $t('page.agileEmergency.summaryStatistics'),
      //           },
      //         },
      //         {
      //           name: 'HisSummary',
      //           path: 'his-summary',
      //           component: () =>
      //           import(
      //             '#/views/agile-emergency/public-engineering/HisSummary.vue'
      //           ),
      //           meta: {
      //             // icon: 'mdi:gauge',
      //             title: $t('page.agileEmergency.hisSummary'),
      //           },
      //         },

      //       ]
      //     },
      //   ],
      // },
    ],
  },
];
// 添加一个检查函数
function checkRoutes(routes: RouteRecordRaw[]) {
  routes.forEach((route) => {
    if (!route.name) {
      console.error('Route missing name:', route);
    }
    if (route.children) {
      checkRoutes(route.children);
    }
  });
}

checkRoutes(routes);

export default routes;
